import javax.swing.*;
import javax.swing.border.EmptyBorder;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

public class Frame extends JFrame {
	public static String tytulOkna = "Tower Defence Game";
	public static Dimension rozmiarOkna = new Dimension(1000, 600);
	public static boolean start = false;
	public static boolean usunScreen = false;
	
	public Frame() {
		setTitle(tytulOkna);
		setSize(rozmiarOkna);
		setResizable(false);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);	
		setLayout(new GridLayout(1, 1, 0, 0));
		setVisible(true);			
		init();
	}	
	
	static JLabel lblImg = new JLabel("");
	{		
		ImageIcon imgBack = new ImageIcon("res/bg.jpg");	
		lblImg.setHorizontalAlignment(SwingConstants.CENTER);
		lblImg.setIcon(imgBack);
	}
	

	public void init() {
		add(lblImg);
		MenuNew menu = new MenuNew();	
		
		while (true) {
			if (start) {
				MobImage mbImg = new MobImage();
				System.out.println("start");
				remove(lblImg);
				//lvlTmr = new Timer();
				Screen screen = new Screen(this);
				add(screen);
				setVisible(true);
				start = false;
				break;
			}						
		}
	}
}
